/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.aal.model;

import com.aal.entity.Product;
/**
 *
 * @author Hoang
 */
public class ProductInCart {

    private int quantity;

    /**
     * Get the value of quantity
     *
     * @return the value of quantity
     */
    public int getQuantity() {
        return quantity;
    }

    /**
     * Set the value of quantity
     *
     * @param quantity new value of quantity
     */
    public void setQuantity(int quantity) {
        this.quantity = quantity;
    }

    private Product product;

    /**
     * Get the value of product
     *
     * @return the value of product
     */
    public Product getProduct() {
        return product;
    }

    /**
     * Set the value of product
     *
     * @param product new value of product
     */
    public void setProduct(Product product) {
        this.product = product;
    }
    
    /**
     * Get the value of subTotal
     *
     * @return the value of subTotal
     */
    public double getSubTotal() {
        return getNetAmount() + getShippingAmount() + getTaxAmount();
    }
    
    public double getNetAmount() {
        return quantity * product.getUnitPrice();
    }
    
    public double getShippingAmount() {
        return quantity * product.getShippingPriceCost();
    }
    
    public double getTaxAmount() {
        return quantity * product.getUnitPrice() * product.getTaxPercent();
    }

}
